Skip to content

Security fixes 2 - #2

Open
Arantis wants to merge 21 commits into
OpenMeridian105:developfrom
Arantis:security-fixes-2
Open

Arantis wants to merge 21 commits into
OpenMeridian105:developfrom
Arantis:security-fixes-2

Conversation

@Arantis

@Arantis Arantis commented Nov 12, 2026

Copy link
Copy Markdown

Collection of fixes found while reviewing and testing the server.

Server (C):

  • Send buffer: compute free space from the current end of data
  • UDP: check datagram and message length
  • Log lines in GodLog/Debug are bounded; client strings with NUL bytes are rejected
  • Client messages: check list length
  • Close the session on an unsupported register request
  • Limit connections per address that have not logged in yet; the login timer is not renewed before login

Trading and offers:

  • Track offer roles; only the receiver answers an offer, and only once
  • Interactive objects (forge, cooking pot, lore pedestal) use up offered ingredients; nothing can be taken out of them
  • Forge and cooking pot: only ingredients of complete recipes are used, as many results as the ingredients allow, leftovers are given back
  • Auctioneer answers offers with an empty counter offer
  • Merchant buy price: factor kept in range, capped at the merchant's own resale price

Items and spells:

  • Check targets when applying items (self only / own items only where it makes sense, healing flask on nearby players)
  • Gem chisel finishes after removing gems
  • Loadout requests the full amount for spell items not carried
  • Conveyance deposits only the checked target
  • Check attribute data length before reading its timer

World:

  • Guild hall rent checks the hall class and availability
  • E5 keeps a single position check timer
  • Locked chests give nothing out until opened

Keep a single open offer per user at interactive objects.
Apply follows the same play state checks as use. Targets are the user,
own items or objects in the same room. Some items narrow this further:
potions of forgetfulness, chalice, arsenic and brown potion only on
oneself; gems, dye and zjiriaesqe only on own items; splitters on own
items or items lying in the room; healers on oneself or a nearby player.
Comment thread blakserv/synched.c

case AP_REGISTER :
eprintf("SynchedProtocolParse AP_REGISTER no longer supported\n");
HangupSession(s);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to hang up the session here. I'd rather make sure the clients we distribute aren't sending this & then stop logging an error message for it, but keep any AP_REGISTER infrastructure in case we want to reimplement in-client registration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants